<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>供应发布</title>
		<!--<link rel="stylesheet" type="text/css" href="css/base.min.css" />
		<link rel="stylesheet" type="text/css" href="css/common.css" />-->
		<link rel="stylesheet" type="text/css" href="{:_SKIN}/user/layui/css/layui.css" media="all" />
		<link rel="stylesheet" type="text/css" href="{:_SKIN}/user/css/baojia.css" />
		
		<style type="text/css">
			.layui-form {
				width: 60%;
			}
			
			.layui-form-select dl {
				min-width: 100%;
			}
			
			.layui-table tr:hover,
			.layui-table[lay-even] tr:nth-child(even) {
				background: #FFFFFF;
			}
			
			.btn {
				width: 250px;
				background: #ff6600;
			}
			
			.layui-table td,
			.layui-table th {
				padding: 5px 25px;
			}
			
			.titlebar {
				margin-bottom: 20px;
			}
			
			.add {
				width: 90%;
			}
			
			.add-1 {
				width: 90%;
				z-index: 997;
			}
			
			.aqq {
				position: relative;
			}
			.asd{
				z-index: 999;
			}
			.aq-1 {
				right: 48px;
			}
			
			.aq-2 {
				left: -97px;
			}
			
			.layui-form-select dl {
				min-width: 100%;
			}
			
			.aq-3 {
				left: -60px;
			}
			
			.pp {
				width: 324%;
			}
			
			.zxc {
				width: 86%;
			}
		</style>
	</head>

	<body>
		<div class="content">
			<div class="titlebar">
				<div class="titlebar-name">发布供应</div>
			</div>
			<form class="layui-form" action="">
				<table class="layui-table" lay-even lay-skin="nob">
					<colgroup>
						<col width="150">
						<col width="200">
						<col>
					</colgroup>
					<tbody>
						<tr>
							<td colspan="2">
								<div class="layui-form-item">
									<label class="layui-form-label">产品类别：</label>
									<div class="layui-input-block add asd">
										<select name="city" lay-verify="">
										<option value="01" selected>请选择</option>
										{volist name="data" id="vo"}
											<option value="">{$vo.Name}</option>
											{/volist}
	
											<!-- <option value="021">畜牧水产</option>
											<option value="0571">粮油米面</option>
											<option value="0571">农副加工</option>
											<option value="0571">苗木花草</option>
											<option value="0571">中药材</option>
											<option value="0571">农资农机</option>
											<option value="0571">食品原料</option>
											<option value="0571">食品加工</option>
											<option value="0571">食品包装</option> -->
										</select>
									</div>
								</div>
							</td>

							<td>
								<div class="layui-form-item aqq aq-1">
									<div class="layui-input-block add asd">
										<select name="city" lay-verify="">
											<option value="010">水果</option>
											<option value="021">蔬菜</option>
										</select>
									</div>
								</div>
							</td>
							<td>
								<div class="layui-form-item aqq aq-2">
									<div class="layui-input-block add asd">
										<select name="city" lay-verify="">
											<option value="010">苹果</option>
											<option value="021">西瓜</option>
											<option value="0571">杏</option>
										</select>
									</div>
								</div>
							</td>
						</tr>
						<tr>
							<td colspan="4">
								<div class="layui-form-item">
									<label class="layui-form-label">产品：</label>
									<div class="layui-input-block">
										<input type="text" name="Name" required lay-verify="required" placeholder="如：土豆" autocomplete="off" class="layui-input s_Name">
									</div>
								</div>
							</td>
						</tr>
						<!--<tr>
							<td colspan="2">
								<div class="layui-form-item">
									<label class="layui-form-label">需求量：</label>
									<div class="layui-input-block aqq">
										<input type="text" name="title" required lay-verify="required" placeholder="所需产品数量" autocomplete="off" class="layui-input pp">
									</div>
								</div>
							</td>
							<td colspan="2">
								<div class="layui-form-item">
									<label class="layui-form-label">单位：</label>
									<div class="layui-input-block aqq">
										<select name="city" lay-verify="">
											<option value="01" selected>吨</option>
											<option value="02">斤</option>
											<option value="03">件</option>
											<option value="03">个</option>
										</select>
									</div>
								</div>
							</td>
						</tr>
						<tr>-->
						<td colspan="2">
							<div class="layui-form-item">
								<label class="layui-form-label">价格：</label>
								<div class="layui-input-block add">
									<input type="text" name="MinPrice" required lay-verify="required" placeholder="单位默认为元" autocomplete="off" class="layui-input s_MinPrice">
								</div>
							</div>
						</td>
						<td>
							<div class="layui-form-item aqq aq-1">
								<label class="layui-form-label aqq" style="left: 13px;">至</label>
								<div class="layui-input-block add">
									<input type="text" name="MaxPrice" required lay-verify="required" placeholder="单位默认为元" autocomplete="off" class="layui-input s_MaxPrice">
								</div>
							</div>
						</td>
						<td>
							<div class="layui-form-item aqq aq-2">
								<div class="layui-input-block zxc">
								<select name="Unit" lay-verify="" class="s_unit">
										<option value="01" selected>吨</option>
										{volist name="unit" id="vo"}
										<option value="02">{$vo.type}</option>
										{/volist}
										
										<!-- <option value="03">件</option>
										<option value="03">个</option> -->
									</select>
								</div>
							</div>
						</td>
						</tr>
						<!--<tr>
							<td colspan="4">
								<div class="layui-form-item">
									<label class="layui-form-label">采购时长：</label>
									<div class="layui-input-block">
										<select name="city" lay-verify="">
											<option value="01" selected>7天内</option>
											<option value="02">30天内</option>
											<option value="03">90天内</option>
											<option value="03">180天内</option>
										</select>
									</div>
								</div>
							</td>
						</tr>-->
						<tr>
							<td colspan="4">
								<div class="layui-form-item">
									<label class="layui-form-label">联系人：</label>
									<div class="layui-input-block">
										<input type="text" name="Contact" required lay-verify="required" placeholder="请输入姓名" autocomplete="off" class="layui-input s_Contact">
									</div>
								</div>
							</td>
						</tr>
						<tr>
							<td colspan="4">
								<div class="layui-form-item">
									<label class="layui-form-label">手机号码：</label>
									<div class="layui-input-block">
										<input type="text" name="Mobile" required lay-verify="required" placeholder="请输入手机号" autocomplete="off" class="layui-input s_Mobile">
									</div>
								</div>
							</td>
						</tr>
						<tr>
							<td colspan="2">
								<div class="layui-form-item">
									<label class="layui-form-label">产地：</label>
									<div class="layui-input-block add-1">
										<select name="city" lay-verify="">
											<option value="">请选择城市</option>
											<option value="010">北京</option>
											<option value="021">上海</option>
											<option value="0571">杭州</option>
										</select>
									</div>
								</div>
							</td>

							<td>
								<div class="layui-form-item aqq aq-1">
									<div class="layui-input-block add-1">
										<select name="city" lay-verify="">
											<option value="">请选择城市</option>
											<option value="010">北京</option>
											<option value="021">上海</option>
											<option value="0571">杭州</option>
										</select>
									</div>
								</div>
							</td>
							<td>
								<div class="layui-form-item aqq aq-2">
									<div class="layui-input-block add-1">
										<select name="city" lay-verify="">
											<option value="">请选择城市</option>
											<option value="010">北京</option>
											<option value="021">上海</option>
											<option value="0571">杭州</option>
										</select>
									</div>
								</div>
							</td>
						</tr>
						<!--<tr>
							<td colspan="4">
								<div class="layui-form-item">
									<label class="layui-form-label">街道地址：</label>
									<div class="layui-input-block">
										<input type="text" name="title" required lay-verify="required" placeholder="例如街道名称，门牌号码，楼层和房间号等信息" autocomplete="off" class="layui-input">
									</div>
								</div>
							</td>
						</tr>-->
						<tr>
							<td colspan="4">
								<label class="layui-form-label">相关图片：</label>
								<input type="button" value="上传图片" class="layui-btn layui-btn-radius layui-btn-warm" />

								<button type="button" name="DefaultImage" value="上传图片"  onclick="but();" class="layui-btn layui-btn-radius layui-btn-warm s_DefaultImage" />
								<span> (长*宽：300*300)</span>
							</td>
						</tr>
						<tr>
							<td colspan="4">
								<div class="layui-form-item">
									<label class="layui-form-label">规格说明：</label>
									<div class="layui-input-block">
										<textarea name="Specification" required lay-verify="required" placeholder="请输入" class="layui-textarea s_Specification"></textarea>
									</div>
								</div>
							</td>
						</tr>
						<tr>
							<td colspan="4">
								<div class="layui-form-item">
									<label class="layui-form-label">包装说明：</label>
									<div class="layui-input-block">
										<textarea name="Pack" required lay-verify="required" placeholder="请输入" class="layui-textarea s_Pack"></textarea>
									</div>
								</div>
							</td>
						</tr>
						<tr>
							<td colspan="4">
								<div class="layui-form-item">
									<label class="layui-form-label">补充说明：</label>
									<div class="layui-input-block">
										<textarea name="" required lay-verify="required" name="Remarks" placeholder="请输入" class="layui-textarea s_Remarks"></textarea>
									</div>
								</div>
							</td>
						</tr>
						<tr>
							<td colspan="4">
								<div class="layui-form-item">
									<div class="layui-input-block">
										<input type="radio" name="sex" value="1" title="我已阅读并同意搜禾" calss="s_sex">
										<a href="{:_SKIN}/user/http://www.isohe.cn/Content/html/xieyi_sell.html" style="position: relative;top: 4px;left: -24px;color: #F8B72C;">《发布供应协议》</a>
									</div>
								</div>
							</td>
						</tr>
						<tr>
							<td colspan="4">
								<div class="layui-form-item">
									<div class="layui-input-block">
										<button class="layui-btn btn layui-btn-danger"  onclick="but();">确认发布</button>
									</div>
								</div>
							</td>
						</tr>
					</tbody>
				</table>
			</form>
			
		</div>

		{:jq()}
		{:layui()}
		<script type="text/javascript">

		function but(){


			var data={
				Name:$('.s_Name').val(),
				MinPrice:$('.s_MinPrice').val(),
				MaxPrice:$('.s_MaxPrice').val(),
				Mobile:$('.s_Mobile').val(),
				unit:$('.s_unit').val(),
				DefaultImage:$('.s_DefaultImage').val(),
				Specification:$('.s_Specification').val(),
				Pack:$('.s_Pack').val(),
				Remarks:$('.s_Remarks').val()
			};
			if(!data.Name||!data.MinPrice||!data.MaxPrice||data.Mobile.length !=11||!data.DefaultImage||!data.Specification||!data.Pack||!data.Remarks){

				 alert('请输入正确的登录信息');
		        return false;

			}
			$.post("{:url('user/buyers/supplyissue')}",data,function(res){
				if(res.code==200){

					alert('添加成功');
					window.location.href="{:url('indexs')}";
				}else{

					alert(res.msg);
				}

			});


		}

		function img(){


			var data={
				DefaultImage:$('.s_DefaultImage').val()
			};
			
			$.post("{:url('user/buyers/img')}",data,function(res){
					alert(1);

		
				if(res.code==200){

					alert('添加成功');
					window.location.href="{:url('indexs')}";
				}else{

					alert(res.msg);
				}




			});

		}


		
		</script>
		
	</body>

</html>